/*                                  ATELIER                                   */

/* %%LICENSE_TAG%%                                                            */
package edu.gmu.view.cube;

import java.awt.BorderLayout;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JSplitPane;
import javax.swing.SwingUtilities;

/**
 * The Main Application.
 * @author  James H. Pope
 * @version $Revision:$ $Date:$
 */
public class CubeMain extends JFrame
{
    /**
     * Creates a new instance of CubeFrame
     */
    public CubeMain( )
    {
        /***************  Set the Title and Size of the Frame  ****************/
        this.setTitle("Atelier");
        this.setSize(1050,700);

        ControlModel controlModel = new ControlModel();
        
        CubePanel cubePanel = new CubePanel( controlModel );

        // Dispose frame on close
        this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);

        // Split components into left/right
        JSplitPane splitPane = new JSplitPane( JSplitPane.HORIZONTAL_SPLIT );
        JPanel westPanel = new JPanel( );
        westPanel.setLayout( new BorderLayout() );
        westPanel.add( cubePanel, BorderLayout.CENTER );
        splitPane.setBottomComponent( westPanel );
        
        ControlPanel controlPanel = new ControlPanel( controlModel );
        splitPane.setTopComponent(controlPanel);

        this.getContentPane().add(splitPane);

        this.setVisible(true);
    }
    
    /**
     *
     * @param args
     * @throws java.lang.Exception
     */
    public static void main( String[] args ) throws Exception
    {
        Runnable lookAndFeelTask = new Runnable()
        {
            public void run( )
            {
                CubeMain frame = new CubeMain( );
            }
        };

        SwingUtilities.invokeAndWait(lookAndFeelTask);
        
    }
    
} // end class CubeMain

/*                                  ATELIER                                   */
